/* eslint-disable @typescript-eslint/no-explicit-any */
import { IHttpResponse } from '../../utils';

/**
 * 请求接口
 *
 * @export
 * @interface INet
 */
export interface INet {
  /**
   * 基础请求方法
   *
   * @param {string} url
   * @param {IParams} [config]
   * @return {*}  {Promise<IHttpResponse>}
   * @memberof INet
   */
  request(url: string, config?: IParams): Promise<IHttpResponse>;

  /**
   * Post 请求
   *
   * @param {string} url
   * @param {IData} data
   * @param {IParams} [params]
   * @param {IParams} [headers]
   * @return {*}  {Promise<IHttpResponse>}
   * @memberof INet
   */
  post(
    url: string,
    data: IData,
    params?: IParams,
    headers?: IParams,
  ): Promise<IHttpResponse>;

  /**
   * Get 请求
   *
   * @param {string} url
   * @param {IParams} [params]
   * @param {IParams} [headers]
   * @param {IParams} [option]
   * @return {*}  {Promise<IHttpResponse>}
   * @memberof INet
   */
  get(
    url: string,
    params?: IParams,
    headers?: IParams,
    option?: IParams,
  ): Promise<IHttpResponse>;

  /**
   * Delete 请求
   *
   * @param {string} url
   * @param {IParams} [params]
   * @param {IParams} [headers]
   * @return {*}  {Promise<IHttpResponse>}
   * @memberof INet
   */
  delete(
    url: string,
    params?: IParams,
    headers?: IParams,
  ): Promise<IHttpResponse>;

  /**
   * Put 请求
   *
   * @param {string} url
   * @param {IData} data
   * @param {IParams} [params]
   * @param {IParams} [headers]
   * @return {*}  {Promise<IHttpResponse>}
   * @memberof INet
   */
  put(
    url: string,
    data: IData,
    params?: IParams,
    headers?: IParams,
  ): Promise<IHttpResponse>;

  /**
   * 获取模型数据
   *
   * @param {string} url
   * @param {IParams} [headers]
   * @return {*}  {Promise<IHttpResponse>}
   * @memberof INet
   */
  getModel(url: string, headers?: IParams): Promise<IHttpResponse>;

  /**
   * 触发 sse 请求
   *
   * @param {string} url
   * @param {IParams} params
   * @param {IParams} [options]
   * @return {*}  {Promise<void>}
   * @memberof INet
   */
  sse(url: string, params: IParams, options?: IParams): Promise<void>;

  /**
   * axios请求
   *
   * @param {IParams} config
   * @return {*}  {Promise<any>}
   * @memberof INet
   */
  axios(config: IParams): Promise<any>;
}
